package com.hexacta.hrs.sandbox.pr.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.hexacta.hrs.sandbox.pr.data.Dao;
import com.hexacta.hrs.sandbox.pr.model.Profile;

public class ProfileServiceImpl implements ProfileService {
	
	@Autowired
	private Dao dao;

	public Dao getDao() {
		return dao;
	}

	public void setDao(Dao dao) {
		this.dao = dao;
	}
	
	@Override
	public Long addProfile(Profile profile) {
		return this.getDao().add(profile);
	}

	@Override
	@SuppressWarnings("unchecked")
	public List<Profile> findProfileByName(String name) {
		return (List<Profile>) this.getDao().findByName(Profile.class, name);
	}

	@Override
	@SuppressWarnings("unchecked")
	public List<Profile> listAll() {
		return (List<Profile>) this.getDao().listAll(Profile.class);
	}

	@Override
	public void removeProfile(Profile profile) {
		this.getDao().remove(profile);
	}
}